package com.photoveil;

import android.widget.ImageView;

public class TextLayer implements Layer {
	private AlphaTextView textView;
	private ImageView thumbnailImage;
	private int alphaValue;
	private TextPreference textPreference;
	
	
	public TextLayer(AlphaTextView textView, ImageView thumbnailImage, int alphaValue, TextPreference textPreference) {
		this.textView = textView;
		this.thumbnailImage = thumbnailImage;
		this.alphaValue = alphaValue;
		this.textPreference = textPreference;
		setAlphaValue(alphaValue);
	}
	
	public AlphaTextView getImage() {
		return textView;
	}
	public void setTextView(AlphaTextView textView) {
		this.textView = textView;
	}
	public ImageView getThumbnailImage() {
		return thumbnailImage;
	}
	public void setThumbnailImage(ImageView thumbnailImageView) {
		this.thumbnailImage = thumbnailImageView;
	}
	public int getAlphaValue() {
		return alphaValue;
	}
	public void setAlphaValue(int alphaValue) {
		this.alphaValue = alphaValue;
		textView.setTextColor(textView.getTextColors().withAlpha(alphaValue));
		textView.setHintTextColor(textView.getHintTextColors().withAlpha(alphaValue));
		textView.setLinkTextColor(textView.getLinkTextColors().withAlpha(alphaValue));
	}
	
	public TextPreference getPreferences() {
		return textPreference;
	}
	
	public void setPreferences(TextPreference textPreference) {
		this.textPreference = textPreference;
	}
	
	public int getLayerType() {
		return Layer.TEXT_LAYER_TYPE;
	}
	
	
}
